<div class="page-content" >
	<div class="panel panel-default">
		<div class="panel-heading">添加权限</div>
		<div class="panel-body">
			  <form id="myform" method="post" class="form-horizontal" action="<{:addons_url('Auth/Index/rule_add_do')}>">
                    <input type="hidden" name="id" value="<{$data.id}>">
                     
                            <div class="form-group">
                                <label for="input-title" class="col-sm-2 control-label">选择组</label>
                                <div class="col-sm-7">
                                   <select name="group_id">
                                       <option value="">--选择组--</option>
                                       <volist name="group" id="vo">
                                       <option value="<{$vo.id}>" <if condition="$data['group_id'] eq $vo['id']">selected</if>><{$vo.title}></option>
                                       </volist>
                                   </select>
                                    
                                </div>
                            </div>
                     
                            <div class="form-group">
                                <label for="input-title"  class="col-sm-2 control-label">标题</label>
                                <div class="col-sm-7">
                                    <input  type="text" class="form-control" class="vmaal_sinw1 input_a1 int_wod" id="title" name="title" value="<{$data.title}>">
                                    
                                </div>
                            </div>

                             <div class="form-group">
                                <label for="input-title" class="col-sm-2 control-label">模块名</label>
                                <div class="col-sm-7">
                                    <input type="text" placeholder="模块名/控制器名称/方法名组合（插件需加Addon）" class="form-control" name="authcode" id="authcode" class="vmaal_sinw1 input_a1 int_wod" value="<{$data.authcode}>">
                                    
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="input-title" class="col-sm-2 control-label">别名</label>
                                <div class="col-sm-7">
                                    <input type="text" placeholder="无别名请留空，用于选中状态" class="form-control" name="short_name" id="short_name" class="vmaal_sinw1 input_a1 int_wod" value="<{$data.short_name}>">
                                     
                                </div>
                            </div>
							
                            <div class="form-group">
                                <label for="input-title" class="col-sm-2 control-label">显示</label>
                                <div class="col-sm-7" >
               <label> <input type="radio"  name="is_show" value="1" checked="checked"  />显示&nbsp;  </label>
               <label> <input type="radio"  name="is_show" value="2" <if condition="$data['is_show'] eq 2">checked="checked" </if>  />不显示</label>
                                </div>
                            </div>
                            
                            <div  id="form-group_url" class="form-group" <if condition="$data['is_show'] eq 2">style="display:none"</if>>
                                <label for="input-title" class="col-sm-2 control-label">链接</label>
                                <div class="col-sm-7">
                                    <input style="width:600px" placeholder="不出现请留空" class="form-control" type="text" name="url" id="url" class="vmaal_sinw1 input_a1 int_wod" value="<{$data.url}>">
                                    
                                </div>
                            </div>
                            
                             <div class="form-group">
					<div class="col-sm-offset-2 col-sm-7">
						<button type="submit" class="btn btn-primary">保存</button>
					</div>
				</div>

                          
                     </form>
		</div>
	</div>
</div>

<script>
 
$(function(){
    $(".form-horizontal").bootstrapValidator({
        message: '您填入的值不合法',
        fields:{
            title: {
                message: '分组名名称',
                validators: {
                    notEmpty: {
                        message: '分组名不能为空'
                    },
                }
            },
			authcode: {
                message: '模块名',
                validators: {
                    notEmpty: {
                        message: '模块名不能为空'
                    },
                }
            },
			authcode: {
                message: '模块名',
                validators: {
                    notEmpty: {
                        message: '模块名不能为空'
                    },
                }
            },
			group_id: {
                message: '选择组',
                validators: {
                    notEmpty: {
                        message: '选择组为空'
                    },
                }
            },
			  

        }
    });
	
 
});
 </script>
<script type="text/jscript">
$("input[name='is_show']").click(function(){
	var v=$(this).val();
	if(v==2){
		$("#form-group_url").hide();
	}else{
		$("#form-group_url").show();
	}
})
</script>
 